/*
 * CS_USER_DEFAULT_INFO.cpp
 *
 *  Created on: 2013. 5. 21.
 *      Author: the2
 */


#include "../../User.h"
#include "dungeon.h"

//#include "../../NLogic/Level.h"
#include "../../NLogic/Static.h"

namespace ProjectZ { namespace NCommand { namespace NDungeon {

void CS_USER_DEFAULT_INFO::OnExecute(User * pUser, ::Network::Packet * pPacket)
{
	PREPARE_PACKET;

	NLogic::Space *pSpace = pUser->GetSpace();
	if (NULL == pSpace)
	{

		return;
	}

	int gid = 0;
	pPacket->ParseMsg("%d", &gid);

	User * pFighter = pSpace->FindUser(gid);
	if (NULL == pFighter)
	{

		return;
	}

	::Network::Packet * pAck = ::Network::GETPACKETPOOL()->SEND_NEW();
	pAck->MsgCat("%2d%2d%2d%2d%2d%2d%2d%s%d%d%c",
			gid,
			pFighter->GetCharacterInfo().helmet,
			pFighter->GetCharacterInfo().armor,
			pFighter->GetCharacterInfo().weapon,
			pFighter->GetCharacterInfo().weapon,
			0,
			pFighter->GetCharacterInfo().level,
			pFighter->GetUserInfo().nickname.c_str(),
			50,//fighter_player_info.attack,
			50,//fighter_player_info.defense,
			pFighter->GetCharacterInfo().classtype);

	pAck->MakePacket(CMD_SC_USER_DEFAULT_INFO);
	pUser->Send(pAck);
}

} /*NDungeon*/ } /*NCommand*/ } /*ProjectZ*/
